package com.example.arithmeticleetcode.leetcode.jan;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: arithmetic-leetcode
 * @description:
 * @author: FangZhen
 * @create: 2021-01-07 09:05
 **/
public class Demo05 {

    public static void main(String[] args) {

    }

    //["kaido","kaido(1)","kaido","kaido(1)","kaido(1)(1)","kaido(1)(1)(2)","kaido(1)(2)"]
    //["kaido","kaido(1)","kaido(2)","kaido(1)(1)","kaido(1)(1)(1)","kaido(1)(1)(2)","kaido(1)(2)"]

    public String[] getFolderNames(String[] names) {
        String[] retArr = new String[names.length];
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < names.length; i++) {
            String name = names[i];
            String substring = name.substring(0, name.indexOf('('));
            map.put(substring, map.getOrDefault(substring, 0) + 1);
        }
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            int[] arr = new int[entry.getValue()];

        }
        return retArr;
    }

    /**
     * 547. 省份数量
     *
     * @param isConnected
     * @return
     */
    public int findCircleNum(int[][] isConnected) {
        return 0;
    }
}
